﻿@model IEnumerable<Scorpicore.Models.ApplicationUser>

<h2>Потребители</h2>

@(Html.Kendo().Grid(Model)
    .Name("applicationUsers-grid")
    .Columns(columns =>
            {
                columns.Bound(p => p.Id);
                columns.Bound(p => p.UserName);
                columns.Bound(p => p.AvatarUrl);
                columns.Template(@<text>@(item.Roles.FirstOrDefault() != null ? "Admin" : "User")</text>);
                columns.Template(@<text>
        @Html.ActionLink("Промяна", "Edit", new { id = item.Id })
                </text>);
                columns.Template(@<text>
        @Html.ActionLink("Изтриване", "Delete", new { id = item.Id })
                </text>);
                columns.Template(@<text>
        @Html.ActionLink("Детайли", "Details", new { id = item.Id })
                </text>);
            })
    .Pageable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Server()
        .Read(read => read.Action("Index", "ApplicationUsersAdministration"))
    .PageSize(10)))
